import time, random


def get_img_path(instance, filename):
    new_name = '%s_%s.%s' % (time.strftime('%Y%m%d%H%M%S'), ''.join(random.sample([str(x) for x in range(1, 10)], 4)),
                             filename.split('.')[-1])
    filepath = '%s/%s/%s' % ('images', time.strftime('%Y%m%d'), new_name)
    return filepath


def get_video_path(instance, filename):
    new_name = '%s_%s.%s' % (time.strftime('%Y%m%d%H%M%S'), ''.join(random.sample([str(x) for x in range(1, 10)], 4)),
                             filename.split('.')[-1])
    filepath = '%s/%s/%s' % ('video', time.strftime('%Y%m%d'), new_name)
    return filepath


def get_file_path(instance, filename):
    new_name = '%s_%s.%s' % (time.strftime('%Y%m%d%H%M%S'), ''.join(random.sample([str(x) for x in range(1, 10)], 4)),
                             filename.split('.')[-1])
    filepath = '%s/%s/%s' % ('files', time.strftime('%Y%m%d'), new_name)
    return filepath



